#include "IdentifierList.h"
//necessary
#include <stdlib.h>
#include "memory-tools.h"

//TODO testing
void initIdentifierList(PidentifierList list){
	*list=NULL;
}

//TODO testing
void addIdentifierInList(PidentifierList list,Pidentifier id){
	PIdentifierElement newelement=(PIdentifierElement)mallocMemory(sizeof(IdentifierElement),"IdentifierList.c:addIdentifierInList:1");
	newelement->label=id;
	LL_APPEND(*list,newelement);
}

//TODO testing
void freeIdentifierList(PidentifierList list){
	PIdentifierElement element;
	PIdentifierElement tmp;

	LL_FOREACH_SAFE(*list,element,tmp){
		LL_DELETE(*list,element);
		freeMemory(sizeof(IdentifierElement),"IdentifierList.c:freeIdentifierList:1");
	}
}
